package com.haoyeteng.sxbd.modular.system.factory;


import org.springframework.beans.BeanUtils;

import com.haoyeteng.sxbd.modular.system.model.Admin;
import com.haoyeteng.sxbd.modular.system.transfer.AdminDto;

/**
 * 用户创建工厂
 *
 * @author haoyeteng
 * @date 2017-05-05 22:43
 */
public class AdminFactory {

    public static Admin createAdmin(AdminDto adminDto){
        if(adminDto == null){
            return null;
        }else{
            Admin admin = new Admin();
            BeanUtils.copyProperties(adminDto,admin);
            return admin;
        }
    }
}
